package com.ruoyi.study.exam.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.study.exam.mapper.StuExamMapper;
import com.ruoyi.study.exam.domain.StuExam;
import com.ruoyi.study.exam.service.IStuExamService;

/**
 * 考试主Service业务层处理
 * 
 * @author twj
 * @date 2023-05-18
 */
@Service
public class StuExamServiceImpl implements IStuExamService 
{
    @Autowired
    private StuExamMapper stuExamMapper;

    /**
     * 查询考试主
     * 
     * @param id 考试主主键
     * @return 考试主
     */
    @Override
    public StuExam selectStuExamById(String id)
    {
        return stuExamMapper.selectStuExamById(id);
    }

    /**
     * 查询考试主列表
     * 
     * @param stuExam 考试主
     * @return 考试主
     */
    @Override
    public List<StuExam> selectStuExamList(StuExam stuExam)
    {
        return stuExamMapper.selectStuExamList(stuExam);
    }

    /**
     * 新增考试主
     * 
     * @param stuExam 考试主
     * @return 结果
     */
    @Override
    public int insertStuExam(StuExam stuExam)
    {
        stuExam.setCreateTime(DateUtils.getNowDate());
        return stuExamMapper.insertStuExam(stuExam);
    }

    /**
     * 修改考试主
     * 
     * @param stuExam 考试主
     * @return 结果
     */
    @Override
    public int updateStuExam(StuExam stuExam)
    {
        stuExam.setUpdateTime(DateUtils.getNowDate());
        return stuExamMapper.updateStuExam(stuExam);
    }

    /**
     * 批量删除考试主
     * 
     * @param ids 需要删除的考试主主键
     * @return 结果
     */
    @Override
    public int deleteStuExamByIds(String[] ids)
    {
        return stuExamMapper.deleteStuExamByIds(ids);
    }

    /**
     * 删除考试主信息
     * 
     * @param id 考试主主键
     * @return 结果
     */
    @Override
    public int deleteStuExamById(String id)
    {
        return stuExamMapper.deleteStuExamById(id);
    }
}
